package net.maku.talent.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import net.maku.framework.common.utils.PageResult;
import net.maku.framework.common.utils.Result;
import net.maku.talent.convert.HonorPersonConvert;
import net.maku.talent.entity.HonorPersonEntity;
import net.maku.talent.service.HonorPersonService;
import net.maku.talent.query.HonorPersonQuery;
import net.maku.talent.vo.HonorPersonVO;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;
import java.util.List;

/**
* 个人荣誉
*
* @author 阿沐 babamu@126.com
* @since 1.0.0 2025-03-21
*/
@RestController
@RequestMapping("talent/honorPerson")
@Tag(name="个人荣誉")
@AllArgsConstructor
public class HonorPersonController {
    private final HonorPersonService honorPersonService;

    @GetMapping("page")
    @Operation(summary = "分页")
    public Result<PageResult<HonorPersonVO>> page(@ParameterObject @Valid HonorPersonQuery query){
        PageResult<HonorPersonVO> page = honorPersonService.page(query);

        return Result.ok(page);
    }

    @GetMapping("{id}")
    @Operation(summary = "信息")
    public Result<HonorPersonVO> get(@PathVariable("id") Long id){
        HonorPersonVO entity = honorPersonService.getDetail(id);
        return Result.ok(entity);
    }




}